package c.c.c.a.a;

import android.os.Looper;
import org.json.JSONException;
import org.json.JSONObject;

/* compiled from: ANRUtils */
public class c {
    public static JSONObject a() throws JSONException {
        StackTraceElement[] stackTrace = Looper.getMainLooper().getThread().getStackTrace();
        JSONObject jSONObject = new JSONObject();
        jSONObject.put("thread_number", 1);
        StringBuilder stringBuilder = new StringBuilder();
        for (StackTraceElement stackTraceElement : stackTrace) {
            String className = stackTraceElement.getClassName();
            stringBuilder.append("  at ");
            stringBuilder.append(className);
            stringBuilder.append(".");
            stringBuilder.append(stackTraceElement.getMethodName());
            stringBuilder.append("(");
            stringBuilder.append(stackTraceElement.getFileName());
            stringBuilder.append(":");
            stringBuilder.append(stackTraceElement.getLineNumber());
            stringBuilder.append(")\n");
        }
        jSONObject.put("mainStackFromTrace", stringBuilder.toString());
        return jSONObject;
    }
}
